function saveReviewData() {

	if (!$("#ff").form('validate')) {
		showMessager("Alert", 'Required fields can not be left blank.');
		return false;
	}

	var data = getFormData("ff");

	data["userId"] = $("#userId").val();
	data["opportunityId"] = $("#opportunityId").val();
	data["prjObjId"] = $("#prjObjId").val();
	data["assignmentId"] = $("#assignmentId").val();

	$.postJSON("saveReviewData.htm?type=financial", data, function(result) {
		if (result.success) {
			showMessager("Info", result.message);

		} else {
			showMessager("Exception", result.message);
		}
	}, function(xhr, ajaxOptions, thrownError) {
		showMessager("Exception", thrownError);
	});
}

function approveReview() {
	if (!$("#ff").form('validate')) {
		$.messager.show({
			title : 'Alert',
			msg : 'Required fields can not be left blank.',
			showType : 'show'
		});
		return false;
	}
	approveReviewOpportunity($("#opportunityId").val(), $("#assignmentId")
			.val(), $("#userId").val(), true);
}
function showAddComments() {
	$("#addNotesContent").html($("#hiddenAddNotes").val());
	$('#winAddNotes').window('open');
	return false;
}

$(document).ready(function() {
	var prjObjId = $("#prjObjId").val();
	$.getJSON('getViewData.htm?prjObjId=' + prjObjId, function(data) {

		if (data.hasOwnProperty("addNotes")) {
			$("#hiddenAddNotes").val(data.addNotes);
			data["addNotes"] = "";
		}
		setFormData("ff", data);
		if ($("#hiddenAddNotes").val() == ""){
			$("#btnShowAddComments").hide();
		}
		//alert($("#hiddenAddNotes").val());
	});

	
});
